package com.hqyj.javaSpringCloudAccount.service;

import com.hqyj.entity.test.City;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author ：Cwd
 * @Description：TestFeignClient
 * @date ：2021/9/3 11:26
 */
@Component
@FeignClient(name = "client-test")
public interface TestFeignClient {

    /**
     * 127.0.0.1/api/test/city/1890 ---- get
     * 此处整合了 Spring MVC 的用法
     * @param cityId
     * @return
     */
    @GetMapping("/api/test/city/{cityId}")
    public City getCityByCityId(@PathVariable int cityId);
}
